/*
Ext.extend(CQCIS.module, {
	init : function() {
		var dwr = {
			updateMsgReadTitsMsgLogin : null,
			findMessageAppendixInfo: null,
			doQueryPageStaffTaskInfos : null,
			pagePublishMessage: null,
			doQueryMessage: null
		};

		var tools = [{
			id : 'gear',
			handler : function() {
				Ext.Msg.alert('Message', 'The Settings tool was clicked.');
			}
		}, {
			id : 'close',
			handler : function(e, target, panel) {
				panel.ownerCt.remove(panel, true);
			}
		}];

		// 查看内容按钮
		var viewBtn = new Ext.Toolbar.Button({
			text : '查看内容',
			iconCls : 'btn_modify',
			handler : function() {
				welcomeWin.show();
				welcomeWin.getBasicForm().setValues({
					msgDesc : panel.items.get(1).items.get(0).items
							.get(0).getSelectedRow().msgDesc
				});
			}
		});
		
		var descMeta = [{
			id : 'id',
			name : 'id',
			fieldLabel : 'ID',
			xtype : 'hidden'
		}, {
			id : 'msgTab',
			name : 'msgTab',
			fieldLabel : '消息标题',
			xtype : 'hidden'
		}, {
			name : 'msgDesc',
			fieldLabel : '消息内容',
			editable : false,
			xtype : 'textarea'
		}, {
			name : 'msgRead',
			fieldLabel : '阅读状态',
			xtype : 'hidden'
		}, {
			field : 'createTime',
			desc : '创建时间',
			xtype : 'hidden'
		}];

		// 消息内容窗口
		var welcomeWin = new CQCIS.Window({
			id : 'welcome_welcomewin',
			title : '消息内容',
			height : 150,
			items : new CQCIS.form.DWRForm({
				labelWidth : 70,
				items : descMeta
			}),
			buttons : [new Ext.Toolbar.Button({
				text : '关闭',
				minWidth : 75,
				handler : function() {
					var check = panel.items.get(1).items.get(0).items.get(0);
					var id = check.getSelectedRow().id;
					welcomeWin.hide();
					dwr.updateMsgReadTitsMsgLogin(id, 1, function(){
						check.refresh();
					});
				}
			})]
		});

		var panel = new Ext.ux.Portal({
			border : false,
			items : [{
				columnWidth : 0.5,
				style : 'padding:10px 5px 10px 10px',
				items : [{
					title : '待办事宜',
					layout : 'fit',
					tools : tools,
					items : [new CQCIS.grid.PageGrid({
						height : 200,
						initload : true,
						firstColumn : 'radio',
						dwr : {
							call : null
						},
						enableColumnResize : false,
						enableColumnMove : false,
						pageSize : 20,
						viewConfig : {
							autoFill : true,
							forceFit : true,
							headersDisabled : true
						},
						metas : [{
							field : 'taskType',
							desc : '任务类型',
							sort : 1,
							hidden: true,
							renderer : function(val) {
								if (val == 1) {
									return '员工任务';
								} else if (val == 2) {
									return '员工分派任务';
								}
							}
						},{
					    	field: 'flag',
					    	desc: '超时标记',
					    	width: 40,
					    	renderer: function translateFun(value){
					        	var str = "";
					            	switch(value){
					            		case '1':
					            			str = '<span class="light_green">&nbsp;&nbsp;&nbsp;&nbsp;</span>';
					            			break;
					            		case '2':
					            			str = '<span class="light_yellow">&nbsp;&nbsp;&nbsp;&nbsp;</span>';
					            			break;
					            		case '3':
					            			str = '<span class="light_red">&nbsp;&nbsp;&nbsp;&nbsp;</span>';
					            			break;
					               	}
					            	return str;
					        }
					    },{
							field : 'workTaskId',
							desc : '任务ID',
							width: 100
						}, {
							field : 'taskName',
							desc : '任务名字',
							width: 100
						}, {
							field : 'levelId',
							desc : '任务级别',
							width: 60,
							renderer : function(val) {
								if (val == 1) {
									return '重要紧急';
								} else if (val == 2) {
									return '重要不紧急';
								}else if (val == 3) {
									return '不重要紧急';
								}else if (val == 4) {
									return '不重要不紧急';
								}
							}
						}, {
							field : 'finishTime',
							desc : '要求完成时间',
							type : 'time',
							width: 120
						}, {
							field : 'state',
							desc : '任务状态',
							width: 50,
							renderer : function(val) {
								if (val == 0) {
									return '未处理';
								} else if (val == 1) {
									return '已创建';
								}else if (val == 3) {
									return '已完成';
								}
							}
						}],
						listeners : {
							'rowdblclick' : function(o) {
								CQCIS.tzParams.workTaskId = panel.items.get(0).items.get(0).items.get(0).getSelectedRow().workTaskId;
								var taskType = panel.items.get(0).items.get(0).items.get(0).getSelectedRow().taskType
								if(taskType == '2')	tzFun('tab_10026', '任务处理', 'ts/roleHandle.js');
								else if(taskType == '1') tzFun('tab_10025', '任务制定', 'ts/roleManage.js');
							}
						}
					})]
				}]
			}, {
				columnWidth : 0.5,
				style : 'padding:10px 5px 10px 10px',
				items : [{
					title : '未读消息',
					tools : tools,
					items : [new CQCIS.grid.PageGrid({
						height : 200,
						initload : true,
						firstColumn : 'radio',
						filter : {
							msgRead : 0
						},
						dwr : {
							call : null
						},
						enableColumnResize : false,
						enableColumnMove : false,
						pageSize : 20,
						viewConfig : {
							autoFill : true,
							forceFit : true,
							headersDisabled : true
						},
						metas : [{
							field : 'id',
							desc : 'ID',
							hidden: true
						}, {
							field : 'msgTab',
							desc : '消息标题',
							width: 100
						}, {
							field : 'msgDesc',
							desc : '消息内容',
							hidden : true
						}, {
							field : 'msgRead',
							desc : '阅读标志',
							width: 60,
							renderer : function(val) {
								if (val == '1') {
									return '已阅';
								} else if (val == '0') {
									return '未阅';
								}
							}
						}, {
							field : 'createTime',
							desc : '创建时间',
							type : 'time',
							width: 100
						}],
						listeners : {
							'rowdblclick' : viewBtn.handler
						}
					})]
				}]
			}, {
				columnWidth : 0.5,
				style : 'padding:10px 5px 10px 10px',
				items : [{
					title : '个人关注',
					tools : tools,
					items : [new Ext.TabPanel({
						height : 200,
						items : [new CQCIS.grid.PageGrid({
							id : 'welcome_taketask',
							title : '我关注的任务',
							height : 180,
							initload : true,
							firstColumn : 'radio',
							filter : {
								type : '1'
							},
							dwr : {
								call : dwr.doQueryPageStaffTaskInfos
							},
							enableColumnResize : false,
							enableColumnMove : false,
							pageSize : 20,
							viewConfig : {
								autoFill : true,
								forceFit : true,
								headersDisabled : true
							},
							listeners: {
							'rowdblclick': function(o){
								CQCIS.tzParams.searchTzFlag = true;
								CQCIS.tzParams.workTaskId = o.ownerCt.items.get(0).getSelectedRow().workTaskId;
								tzFun('tab_10029', '任务综合查询', 'ts/roleSearchMain.js');
							}
							},
							metas : [{
								field : 'workTaskId',
								desc : '任务号',
								width: 100
							}, {
								field : 'type',
								desc : '类型',
								hidden: true
							}, {
								field : 'workTaskName',
								desc : '任务名字',
								width: 100
							}, {
								field : 'taskEndtime',
								desc : '要求完成时间',
								type: 'time',
								width: 100
							}, {
								field : 'state',
								desc : '任务状态',
								width: 60,
								renderer : function(val) {
									if (val == '0') {
										return '已创建';
									} else if (val == '1') {
										return '待启动';
									} else if (val == '2') {
										return '进行中';
									} else if (val == '3') {
										return '已完成';
									} else if (val == '4') {
										return '已关闭';
									}
								}
							}]
						}), new CQCIS.grid.PageGrid({
							id : 'welcome_submittask_grid',
							title : '我提交的任务',
							height : 180,
							initload : true,
							firstColumn : 'radio',
							filter : {
								type : '2'
							},
							dwr : {
								call : dwr.doQueryPageStaffTaskInfos
							},
							enableColumnResize : false,
							enableColumnMove : false,
							pageSize : 20,
							viewConfig : {
								autoFill : true,
								forceFit : true,
								headersDisabled : true
							},
							metas : [{
								field : 'workTaskId',
								desc : '任务号',
								width: 100
							}, {
								field : 'workTaskName',
								desc : '任务名字',
								width: 100
							}, {
								field : 'taskEndtime',
								desc : '要求完成时间',
								type : 'time',
								width: 100
							}, {
								field : 'state',
								desc : '任务状态',
								width: 60,
								renderer : function(val) {
									if (val == '0') {
										return '已创建';
									} else if (val == '1') {
										return '待启动';
									} else if (val == '2') {
										return '进行中';
									} else if (val == '3') {
										return '已完成';
									} else if (val == '4') {
										return '已关闭';
									}
								}
							}]
						})],
						listeners : {
							'render' : function(o) {
								o.setActiveTab.defer(100, o, ['welcome_taketask']);
							}
						}
					})]
				}]
*/
					/*
					 * items:[{ //title: '我关注的任务', tools: tools, items: [new
					 * CQCIS.grid.PageGrid({ title: '我关注的任务', height: 282,
					 * initload: true, firstColumn: 'radio', filter: { type: '1' },
					 * dwr: { call: roleManageDwr.doQueryStaffSumTask },
					 * enableColumnResize: false, enableColumnMove: false,
					 * pageSize: 20, viewConfig: { autoFill: true, forceFit:
					 * true, headersDisabled: true }, metas: [{ field:
					 * 'workTaskId', desc: '任务号' }, { field: 'type', desc: '类型' }, {
					 * field: 'workTaskName', desc: '任务名字' }, { field:
					 * 'taskBegtime', desc: '要求开始时间' }, { field: 'taskEndtime',
					 * desc: '要求完成时间' }, { field: 'state', desc: '任务状态',
					 * renderer: function(val) { if (val == '0') { return '已创建'; }
					 * else if (val == '1') { return '待启动'; }else if (val ==
					 * '2') { return '进行中'; }else if (val == '3') { return
					 * '已完成'; }else if (val == '4') { return '已关闭'; } } }]
					 * }),new CQCIS.grid.PageGrid({ title: '我提交的任务', height:
					 * 282, initload: true, firstColumn: 'radio', filter: {
					 * type: '2' }, dwr: { call:
					 * roleManageDwr.doQueryStaffSumTask }, enableColumnResize:
					 * false, enableColumnMove: false, pageSize: 20, viewConfig: {
					 * autoFill: true, forceFit: true, headersDisabled: true },
					 * metas: [{ field: 'workTaskId', desc: '任务号' }, { field:
					 * 'type', desc: '类型' }, { field: 'workTaskName', desc:
					 * '任务名字' }, { field: 'taskBegtime', desc: '要求开始时间' }, {
					 * field: 'taskEndtime', desc: '要求完成时间' }, { field: 'state',
					 * desc: '任务状态', renderer: function(val) { if (val == '0') {
					 * return '已创建'; } else if (val == '1') { return '待启动';
					 * }else if (val == '2') { return '进行中'; }else if (val ==
					 * '3') { return '已完成'; }else if (val == '4') { return
					 * '已关闭'; } } }] })] }]
					 */
/*			},{
				columnWidth : 0.5,
				style : 'padding:10px 5px 10px 10px',
				items : [{
					title : '信息',
					tools : tools,
					items : [new Ext.TabPanel({
						height : 200,
						items : [new CQCIS.grid.PageGrid({
							id : 'welcome_message_main',
							title : '信息',
							//height : 600,
							initload : true,
							firstColumn : 'radio',
							filter : {
								type : '1'
							},
							dwr : {
								call : null
							},
							enableColumnResize : false,
							enableColumnMove : false,
							pageSize : 20,
							viewConfig : {
								autoFill : true,
								forceFit : true,
								headersDisabled : true
							},
							listeners: {
							'rowdblclick': function(o){
								messageWin.show();
							},
							'render': function(o){
								o.getSelectionModel().on('selectionchange', function(p) {
								if (p.getCount() != 1) {
												panel.items.get(3).items.get(0).items.get(0).items.get(1).disable();
												
												//panel.items.get(3).items.get(0).items.get(0).items.get(1).items.get(0).filter['newsUpId'] = o.items.get(0).getSeletedRow.newsUpId;
					                        } else {
					                           
					                       		panel.items.get(3).items.get(0).items.get(0).items.get(1).enable();
					                       		//alert(panel.items.get(3).items.get(0).items.get(0).items.get(0).getSelectedRow().newsUpId);
					                        	
					                        }
								});
							}
							},
							metas : [{
					            id: 'newsUpId',
					            field: 'newsUpId',
					            desc: 'ID',
					            hidden: true
					        }, {
					            field: 'newsUpName',
					            desc: '标题',
					            width: 100
					        }, {
					            field: 'newsUpDesc',
					            desc: '内容',
					            width: 100
					        }, {
					            field: 'newsUpType',
					            desc: '信息发布类型',
					            width: 80,
					            render: function translateFun(value){
					            	var str = "";
					            	switch (value) {
					                    case '1':
					                        str = "新闻";
					                        break;
					                    case '2':
					                        str = "通知";
					                        break;
					                }
					                return str;
					            }
					        }, {
					            field: 'createTime',
					            desc: '信息发布时间',
					            width: 80,
					            type: 'time'
					        },/*{
					        	field: 'begTime',
					            desc: '信息发布生效时间',
					            width: 80,
					            type: 'time'
					        },{
					        	field: 'endTime',
					            desc: '信息发布失效时间',
					            width: 80,
					            type: 'time'
					        },*/
/*					        {
					            field: 'state',
					            desc: '状态',
					            width: 60,
					            renderer: function translateFun(value) {
					                var str = "";
					                switch (value) {
					                    case '0':
					                        str = "无效";
					                        break;
					                    case '1':
					                        str = "有效";
					                        break;
					                }
					                return str;
					            }
					        }]
						}), new CQCIS.grid.ListGrid({
							id : 'welcome_message_appendix',
							title : '附件',
							height : 180,
							initload : false,
							firstColumn : 'radio',
							disabled: true,
							filter : {
								type : '2'
							},
							dwr : {
								call : null
							},
							enableColumnResize : false,
							enableColumnMove : false,
							pageSize : 20,
							viewConfig : {
								autoFill : true,
								forceFit : true,
								headersDisabled : true
							},
							listeners: {
								'render': function(o){
									panel.items.get(3).items.get(0).items.get(0).items.get(1).filter['newsUpId'] 
					                        	= panel.items.get(3).items.get(0).items.get(0).items.get(0).getSelectedRow().newsUpId;  //赋参数
									panel.items.get(3).items.get(0).items.get(0).items.get(1).reload();
									panel.items.get(3).items.get(0).items.get(0).items.get(1).on('show',function(o){
										panel.items.get(3).items.get(0).items.get(0).items.get(1).filter['newsUpId'] 
					                        	= panel.items.get(3).items.get(0).items.get(0).items.get(0).getSelectedRow().newsUpId;  //赋参数
										panel.items.get(3).items.get(0).items.get(0).items.get(1).reload();
									});
								}
								
							},
							metas : [{
							id : 'fjDocId',
							desc : '附件ID',
							field : 'fjDocId',
							hidden : true,
							type : 'int'
						}, {
							field : 'fjTaskId',
							desc : '任务ID',
							field : 'fjTaskId',
							hidden : true
						}, {
							field : 'fjDocId',
							desc : '下载',
							width : 30,
							renderer : function(url) {
								var href_str = "downFjload?fjDocId=" + url
										+ "&ItsmUserAddr="
										+ CQCIS.SM.TISM_UREF_DELFILE;
								return '<a target="_blank" href=\"'
										+ href_str
										+ '\"><span class="ondwon_black"></span>&nbsp;下载</a>'
							}
						}, 
						{
							field : 'fjDocName',
							desc : '文件名字',
							width : 120
						}, {
							field : 'fjDocAddr',
							desc : '文件路径',
							width : 130
						}, {
							field : 'fjDocUptime',
							desc : '文件上传时间',
							type : 'time',
							width : 60
						}, {
							field: 'fjLoginId',
							desc : '上传员工id',
							hidden: true
						},{
							field : 'staffName',
							desc : '上传员工',
							//hidden : true,
							width : 40
						}]
						})],
						listeners : {
							'render' : function(o) {
								o.setActiveTab.defer(100, o, ['welcome_message_main']);
							}
						}
					})]
				}]
			}]
		});
		
		
		
		var messageMeta = [{
					name: 'newsUpName',
					fieldLabel : '标题',
					readonly: true
				},{
					name: 'newsUpDesc',
					fieldLabel: '信息发布内容',
					xtype: 'textarea',
					readonly: true
				}];
		
		var messageForm = new CQCIS.form.DWRForm({
					labelWidth : 60,
					items : messageMeta,
					afterSubmit : function() {
					}
				});
		
		// 信息发布内容弹出窗口
		var messageWin = new CQCIS.Window({
					id : 'ts_messageDetail_win',
					//title : 'ddd',
					width : 300,
					height : 200,
					items : messageForm,
					buttons : [ {
						text : '关闭',
						handler : function(o) {
							o.ownerCt.hide();
						}
					}],
					listeners: {
						'show': function(o){
							var newsUpId = panel.items.get(3).items.get(0).items.get(0).items.get(0).getSelectedRow().newsUpId;
							dwr.doQueryMessage(newsUpId,function(o){
								messageWin.items.get(0).find('name','newsUpName')[0].setValue(o.newsUpName);
								messageWin.items.get(0).find('name','newsUpDesc')[0].setValue(o.newsUpDesc);
							});
							//alert(messageWin.items.get(0).find('name','newsUpName'));
							//messageWin.items.get(0).find('name','newsUpName')[0].setValue(panel.items.get(3).items.get(0).items.get(0).getSelectedRow().newsUpName);
							//messageWin.items.get(0).find('name','newsUpDesc')[0].setValue(panel.items.get(3).items.get(0).items.get(0).getSelectedRow().newsUpDesc);
							
						}
					}
				});


		function tzFun(tabName, tabTitle, tabUrl) {
			moduleId = tabName;
			CQCIS.tzParams.firstTZ = true;
			if (cmApp.center.findById(tabName)) {
				cmApp.center.findById(tabName).show();
				return;
			}
			// var myMask = new Ext.LoadMask(Ext.getBody(), {msg:"Please
			// wait..."});
			// myMask.show();
			var panelTZ = cmApp.center.add({
				id : tabName,
				title : tabTitle,
				closable : true,
				layout : 'fit'
			}).show();
			Ext.Ajax.request({
				method : 'GET',
				url : '' + tabUrl,
				success : function(response) {
					var module = eval(response.responseText);
					CQCIS.app[tabName] = new module(panelTZ);
					// cmApp.loadMask.hide();
					// myMask.hide();
				}
			});
		}

		this.main.associatedComp = [];
		this.main.add(panel);
		this.main.doLayout();
	}
});
*/